<?php
/**
 * iphp参数初始化
 */
namespace i;



error_reporting(E_ALL);
ini_set("memory_limit",-1);

//get请求中开启debug模式。和定义DUG。
$server_name=&$_SERVER['SERVER_NAME'];
$server_name=='localhost' and ini_set("display_errors",'On');
if(isset($_REQUEST['_dug']) && $_REQUEST['_dug']==2)
{
    ini_set("display_errors",'On');
    define('DUG',true);
}else{
    define('DUG',false);
}


//定义WEB_ADS常量
$server_name='';
isset($_SERVER['HTTP_HOST']) and $server_name=$_SERVER['HTTP_HOST'];
$server_name or $server_name="localhost";
define('WEB_ADS',$server_name);
//var_dump($_SERVER);

//定义THISURL常量
$request_url='';
isset($_SERVER['REQUEST_URI']) and $request_url=$_SERVER['REQUEST_URI'];
define('THISURL','http://'.WEB_ADS.$request_url);

//判断是否是开发环境访问，定义TESTENV常量
if($server_name=='localhost')
{
    define('TESTENV',true);
}else{
    define('TESTENV',false);
}